package com.avril.service;

import java.util.Vector;

import com.avril.db.GoodsDao;
import com.avril.entity.Goods;

public class GoodsService {
	GoodsDao goodsDao = null;

	public Vector<Goods> getAllGoods() {
		goodsDao = new GoodsDao();
		return goodsDao.getAllGoods();
	}

	public Vector<String> getGoodsNameByType(String goodsTypeName) {
		goodsDao = new GoodsDao();
		return goodsDao.getGoodsNameByType(goodsTypeName);
	}

	public Goods findGoodsByPropety(String key, String value) {
		goodsDao = new GoodsDao();
		return goodsDao.findGoodsByPropety(key, value);
	}

	public boolean addGoods(Goods goods) {
		goodsDao = new GoodsDao();
		return goodsDao.addGoods(goods);
	}

	public void updateGoods(Goods goods) {

	}

	public boolean deleteGoods(String key, String value) {
		goodsDao = new GoodsDao();
		return goodsDao.deleteGoods(key, value);
	}

	public boolean isExist(String goodsCode, int goodsTypeId) {
		goodsDao = new GoodsDao();
		return goodsDao.isExist(goodsCode, goodsTypeId);
	}

	public Vector<Goods> getGoodsByType(String typeName) {
		goodsDao = new GoodsDao();
		return goodsDao.getGoodsByType(typeName);
	}

}
